-module(p19).
-compile(export_all).

result(DayNum) -> lists:flatlength(main(DayNum)).

main(DayNum) ->
    [{Year, Month, 1} || Year <- lists:seq(1901, 2000),
             Month <- lists:seq(1, 12),
             calendar:day_of_the_week(Year, Month, 1) =:= DayNum].
